package com.erp.erp_servers.warehouse.imp;

import com.erp.erp_dao.warehouse.IOtherInStockDetailDao;
import com.erp.erp_entitys.warehouse.entity.OtherInStockDetailEntity;
import com.erp.erp_entitys.warehouse.req.sellOutStockStatistics1Req;
import com.erp.erp_entitys.warehouse.rsp.OtherInStockProductStatisticsRsp;
import com.erp.erp_servers.warehouse.IOtherInStockDetailService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @ClassName : OtherInStockDetailServiceImp
 * @Description : 其它入库明细接口实现类
 * @Author : lst
 * @Date: 2021-03-24 18:30
 */
@Service
public class OtherInStockDetailServiceImp implements IOtherInStockDetailService {

    /**
     * 注入mapper
     */
    private final IOtherInStockDetailDao otherInStockDetailDao;

    @Autowired
    public OtherInStockDetailServiceImp(IOtherInStockDetailDao otherInStockDetailDao) {
        this.otherInStockDetailDao = otherInStockDetailDao;
    }


    /**
     * 通过ID查询单条数据
     *
     * @param id 主键
     * @return 实例对象
     */
    @Override
    public OtherInStockDetailEntity queryById(Integer id) {
        return otherInStockDetailDao.queryById(id);
    }

    /**
     * 通过实体作为筛选条件查询
     *
     * @param otherInStockDetail 实例对象
     * @return 对象列表
     */
    @Override
    public List<OtherInStockDetailEntity> queryAll(OtherInStockDetailEntity otherInStockDetail) {
        return otherInStockDetailDao.queryAll(otherInStockDetail);
    }

    /**
     * 新增数据
     *
     * @param otherInStockDetail 实例对象
     * @return 影响行数
     */
    @Override
    public int insert(OtherInStockDetailEntity otherInStockDetail) {
        return otherInStockDetailDao.insert(otherInStockDetail);
    }

    /**
     * 详情批量新增
     * @param list 新增对象集合
     * @return 影响行数
     */
    @Override
    public int addList(List<OtherInStockDetailEntity> list) {
        return otherInStockDetailDao.addList(list);
    }

    /**
     * 修改数据
     *
     * @param otherInStockDetail 实例对象
     * @return 影响行数
     */
    @Override
    public int update(OtherInStockDetailEntity otherInStockDetail) {
        return otherInStockDetailDao.update(otherInStockDetail);
    }

    /**
     * 获取入库详情信息
     * @param otherInStockDetail 实例对象
     * @return 入库详情信息
     */
    @Override
    public List<OtherInStockDetailEntity> getOtherInStockDetail(OtherInStockDetailEntity otherInStockDetail) {
        return otherInStockDetailDao.getOtherInStockDetail(otherInStockDetail);
    }

    /**
     * 其它入库产品统计
     * @param req 查询对象
     * @return 其它入库产品统计
     */
    @Override
    public List<OtherInStockProductStatisticsRsp> statisticsProductInfo(sellOutStockStatistics1Req req) {
        return otherInStockDetailDao.statisticsProductInfo(req);
    }
}
